package cn.topcodes.tcsf.admin.service;

import cn.topcodes.tcsf.admin.service.log.SysOperateLogService;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * Created by Unicorn on 2017/9/27.
 */
@Aspect
@Component
public class OperateLogInspector {

    @Autowired
    private SysOperateLogService logService;

    @Pointcut("execution(@org.springframework.transaction.annotation.Transactional * *(..))")
    public void pointcut(){
    }

    @Before("pointcut()")
    public void before() {
        logService.incLevel();
    }
}
